package com.fly.web;

import com.fly.base.Result;
import com.fly.base.ResultGenerator;
import com.fly.domain.model.SysColumns;
import com.fly.service.MySysColumnsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by frinder on 2018/4/3.
 */
@RestController
@RequestMapping("/mySysColumns")
public class MySysColumnsController {

    @Autowired
    private MySysColumnsService mySysColumnsService;

    @ApiOperation(value = "根据 getByTableName 获取列配置")
    @GetMapping("/getByTableName")
    public Result getByTableName(@RequestParam String tableName) {
        List<SysColumns> list = mySysColumnsService.getByTableName(tableName);
        return ResultGenerator.genSuccessResult(list);
    }

}
